package com.dongdongshop.service.impl;

import com.dongdongshop.dao.ContentRepository;

import com.dongdongshop.pojo.content.TbContent;
import com.dongdongshop.service.content.ContentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author Eayon
 * @Date 2020/4/3 14:31
 */
@Service
public class ContentServiceImpl implements ContentService {

    private static final Logger log = LoggerFactory.getLogger(ContentServiceImpl.class);

    @Autowired
    private ContentRepository contentRepository;

    /**
     * 按照广告分类查找分类下审核通过的广告信息
     * @param categoryId
     * @return
     */
    @Override
    public List<TbContent> findByCategoryId(Long categoryId) {
        List<TbContent> contents = contentRepository.findByCategoryIdAndStatusEquals(categoryId, "1");
        return contents;
    }
}
